For example, there is a semiconductor device such as a HEMT or the like including a GaN layer and an AlGaN layer. It is desirable to improve the characteristics of the semiconductor device.